Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- o<1000> sub (Begin subroutine)
- ; Set probe radius
- #<_probe_radius> = 0.9975
- ; Probe Y-axis edge (back edge of stock- farthest away from operator)
- G38.2 Y-10 F100
- G91 G0 Y3 (Retract Y-axis a bit)
- G38.2 Y-10 F100
- #<_y_probed> = #5062 (Store probed Y position)
- ; Retract the probe and move to the back-left corner
- G91 G0 Y5
- G0 X-10
- G0 Y-10
- ; Probe the left edge along X-axis (left side of stock)
- G38.2 X10 F100
- G91 G0 X-1 (Retract X-axis a bit)
- G38.2 X10 F100
- #<_x_probed> = #5061 (Store probed X position)
- ; Set the work origin at the back-left corner, accounting for the probe radius
- G92 X[#<_x_probed> - #<_probe_radius>] Y[#<_y_probed> + #<_probe_radius>]
- ; Move back to Z home
- G0 Z0
- ; Return the tool to the newly set work origin
- G0 X0 Y0
- o<1000> endsub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement